/*
 * Description: 用来申明通信过程中，服务端和客户端需要同步的信息。
 */
#ifndef GUEST_LINK_COMMON
#define GUEST_LINK_COMMON

#include <cstdint>
#include <string>

namespace COMMON {
enum class LinkType {
    LINK_SERIAL,
    LINK_TYPE_MAX
};

const std::string LINK_SERIAL_HEAD = "Serial:";

constexpr uint8_t HEAD_SIZE = 7;
constexpr uint32_t READ_SIZE = 1024;
constexpr uint32_t ASYNC_CALLID = 0;
constexpr int32_t DEFAULT_TIME_OUT = -1;
const std::string GUEST_READ = "guest-read-connection:";
const std::string GUEST_WRITE = "guest-write-connection:";
const std::string GUEST_EVENT = "guest-event-connection:";

/**
 * 认证类型，默认不认证
 */
enum class AuthType {
    COMMON_SERVER,
    AUTH_SERVER,
};

/**
 * 服务初始化类型
 */
enum class ServerType {
    SYNC_SERVER,
    ASYNC_SERVER,
    SERIAL_SERVER,
};

/**
 * 通信发送的消息类型
 */
enum class MessageType {
    SYNC_CALL,
    NOTIFICATION,
    RESPONSE,
    INIT_TYPE,
};

struct SocketInfo {
    std::string userId;
    std::string appId;
    std::string vmName;
    int port;
};
}
#endif // GUEST_LINK_COMMON
